Test FAMS on 5D data

Contents

randomize data

vect1 = rand(1000,5)*100; % uniform

sigma2=[1,3,1,3,2]*5;
mu2=[70,60,70,55,89];
vect2 = randn(120,5);
vect2 = vect2.*repmat(sigma2,size(vect2,1),1)+repmat(mu2,size(vect2,1),1);

sigma3=[1,3,1,3,2]*5;
mu3=[20,10,15,55,9];
vect3 = randn(100,5);
vect3 = vect3.*repmat(sigma3,size(vect3,1),1)+repmat(mu3,size(vect3,1),1);

data=[vect1;  vect2; vect3];

run FAMS

[modes, p_modes, w_modes]=fams(data,20,15,200,'5Ddata','res/','-h',20);
Load data points from matlab ...done
RunFAMS with res/pilot_200_5Ddata.txt ...
Running FAMS with K=20 L=15
 Run pilot fixed bandwith...done.
 Start MS iterations..........done.
 Join Modes with adaptive h/2, min pt=40, jump=1
            pass 1.done
            pass 2..........nrel 6
0 0
1 1
2 2
3 3
4 4
5 5
done
Save convergence points   ...done
Save joined convergence points ...done
Save indicies of modes  ...done
FAMS done.

view results

format short g;
p_modes

% this script results:
% p_modes =
%          1533       70.356        60.01       69.579       56.076       89.433
%          1162       19.909       9.4154       15.675       54.572       8.4813
%            48       36.851       29.007       82.868       43.807       28.804
%            47       37.235       26.553       49.035       28.731       71.776


% % here the results of meanshift_Euclidian function
% % the first two vectors in <res> matrix - view like <mu2> and <mu3> vectors
% % [res, num_rows,mean_vals,data_group, sample_num ] =meanshift_Euclidian(data,0.1);
% %>> res(1:4,:)
% % ans =
% %    70.0758   59.9020   70.0746   54.5983   88.6178
% %    19.8981   10.0129   14.9481   55.1258    9.3043
% %    87.8244   37.2915   64.2528   58.1243   37.1069
% %    41.5967   27.2727   49.5976   19.0590   12.5807
% % >> size(res)
% % ans =
% %    535     5
% % >> num_rows(1:15,:)
% % ans =
% %    126
% %    107
% %     14
% %     11
% %
% % ===========================================
% % >> ans =
% %    546     5
% % ans =
% %    69.9826   59.7245   70.1298   54.9041   89.0960
% %    20.0367    9.7626   15.0001   55.1254    9.0817
% %    72.1779   16.1155   43.0180   51.8788   81.5878
% %    18.3489   57.1178   72.5199   35.9218   50.6380
% % ans =
% %    127
% %    100
% %     14
% %     14
p_modes =
          446       70.369       57.104       69.913       55.933       88.223
          315       21.429       8.8381       14.123        56.03       8.5525
           98       76.775       26.421       71.663        52.89       48.564
           58       84.778       69.555       45.305       78.922        29.83
           54       44.767       34.338       36.552       46.509       30.843
           46       27.184       33.584       54.598       27.461        33.91